package com.mszlu.blog.controller;

import com.mszlu.blog.service.LoginService;
import com.mszlu.blog.vo.Result;
import com.mszlu.blog.vo.params.LoginParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author linKe
 */
@Api(value="退出登录",tags = "logoutApi")
@RestController
@RequestMapping("logout")
public class LogoutController {

    @Resource
    private LoginService loginService;


    @ApiOperation(value = "登录退出")
    @ApiImplicitParam(name = "token",value = "用户登录的认证信息")
    @GetMapping
    public Result logout(@RequestHeader("Authorization") String token){
        return loginService.logout(token);
    }
}
